package com.hdaccp.xingmu.controller;

import com.hdaccp.xingmu.dao.ContenttypeDao;
import com.hdaccp.xingmu.entity.Contenttype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

@Controller
@RequestMapping("/contenttype")
public class ContenttypeCon {


    @Autowired
    private ContenttypeDao contenttypeDao;

    @PersistenceContext
    private EntityManager entityManager ;


    @RequestMapping("/quanbu")
    @ResponseBody
    public List<Contenttype> query(){
        return contenttypeDao.findAll();
    }

}
